package com.lg.utils;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;

/**
 */
@SuppressWarnings("rawtypes")
public class PageModel extends Model<Model> {
	private static final long serialVersionUID = 1L;
	
	public PageModel() {
		
	}
	// 总记录数
	@TableField(exist=false)
	private long total;
	// 列表数据
	@TableField(exist=false)
	private List<?> rows;
	//页面大小
	@TableField(exist=false)
	private int limit;
	
	//页码
	@TableField(exist=false)
	private int offset;
	
	//排序字段
	@TableField(exist=false)
	private String order;
	
	//降序/升序
	@TableField(exist=false)
	private String sort;
	
	// 获取数据正常
	@TableField(exist=false)
	private int code=0;
	

	/**
	 * 分页
	 * 
	 * @param list
	 *            列表数据
	 * @param total
	 *            总记录数
	 */
	public PageModel(List<?> list, long total) {
		this.rows = list;
		this.total = total;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public List<?> getRows() {
		return rows;
	}

	public void setRows(List<?> rows) {
		this.rows = rows;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public int getOffset() {
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	
	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	@Override
	protected Serializable pkVal() {
		return null;
	}
}
